export default class Singleton{
    constructor() {
        window[this.constructor.name] = this.constructor;
    }
    static ins<T extends {}>(this: new () => T): T {
        if(!(<any>this).instance){
            (<any>this).instance = new this();
        }
        return (<any>this).instance;
    }
}